package com.md.value;

import com.md.base.EnumBase;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author 刘骄阳
 * 2025-01-15 17:33
 */
@Getter
@AllArgsConstructor
public enum AppTypeEnum implements EnumBase {
  PUBLIC(0, "开放"), PRIVATE(1, "私有");
  private static final Map<Integer, AppTypeEnum> ENUM_MAP = Arrays.stream(AppTypeEnum.values())
    .collect(Collectors.toMap(EnumBase::getCode, e -> e));
  private final Integer code;
  private final String message;

  public static AppTypeEnum of(final Integer code) {
    return ENUM_MAP.get(code);
  }
}
